/****************************************************************************
 * Copyright (C) 2025 Chenyz. All rights reserved.
 *
 * @file    TinyOS_Task.c
 *
 * @par     dependencies
 *          - TinyOS_Objects.h
 *
 * @author  Chenyz
 *
 * @brief   Task scheduler implementation module for TinyOS with following features:
 *          - Preemptive priority-based task scheduling
 *          - Task context management and switching
 *          - Task delay functionality with system tick support
 *          - Scheduler locking mechanism for critical sections
 *          - Support for multiple priority levels
 *          - Cross-platform compatibility (bare-metal/RTOS systems)
 *
 * @version V1.0
 * @date    2025-09-16
 *
 * @note    Coding standard:
 *          - 4 spaces per indent level
 *          - Follow MISRA-C 2012 guidelines
 *          - Compiler compatibility: C99 and above
 *
 ****************************************************************************/
 
#include "TinyOS_Objects.h"

TinyOS_TaskType*        CurrentTask;       
TinyOS_TaskType*        NextTask;      
TinyOS_TaskType*        IdleTask;   
TinyOS_TaskType         IdleTaskHandler;
TinyOS_TaskType         TimerTaskHandler;
TinyOS_TaskStackType    IdleTaskStack[TINYOS_IDLE_TASK_STACK];
TinyOS_TaskStackType    TimerTaskStack[TINYOS_TIMER_TASK_STACK];
TinyOS_ListType         TaskList[TINYOS_TASK_PRIORITY_COUNT]; 
TinyOS_BitmapType       TaskPriorityBitmap; 
TinyOS_ListType         TaskDelayList;
TinyOS_ListType         TimerIntList;
TinyOS_ListType         TimerTaskList;
TinyOS_TaskType*        TimerTask; 
TinyOS_SemaphoreType    TimerProtectSem;
TinyOS_SemaphoreType    TimerTickSem;
uint8_t                 SchedulerLockCount;  
uint32_t				IdleTaskRunningCount;
uint32_t				IdleTaskRunningCountMax;
uint32_t				SysTickCount;
uint32_t 				EnableCpuUsageState;

